using System;
using System.Collections.Generic;
using NHibernate.Search.Attributes;
using NHibernate.Search;

namespace Ic.Model
{
	#region BandsmanWork

	/// <summary>
	/// BandsmanWork object for NHibernate mapped table 'TB_BandsmanWorks'.
	/// </summary>
	[Serializable]
	[TableInfo(TableName = "TB_BandsmanWorks", PrimaryKey = "Id" , Columns="Id,BandsmanId,WorksTitle,WorksUrl,WorksDesc,RegDate,Idx")]
	[Indexed(Index = "BandsmanWork")] 
	public class BandsmanWork
	{
		#region Member Variables
		
		protected int _id;
		protected int _bandsmanId;
		protected string _worksTitle;
		protected string _worksUrl;
		protected string _worksDesc;
		protected DateTime _regDate;
		protected int _idx;

		#endregion

		#region Constructors

		public BandsmanWork() { }

		public BandsmanWork( int bandsmanId, string worksTitle, string worksUrl, string worksDesc, DateTime regDate, int idx )
		{
			this._bandsmanId = bandsmanId;
			this._worksTitle = worksTitle;
			this._worksUrl = worksUrl;
			this._worksDesc = worksDesc;
			this._regDate = regDate;
			this._idx = idx;
		}

		#endregion

		#region Public Properties

		[DocumentId]
		public virtual int Id
		{
			get {return _id;}
			set {_id = value;}
		}

		public virtual int BandsmanId
		{
			get { return _bandsmanId; }
			set { _bandsmanId = value; }
		}

		[Field(Index.Tokenized, Store = Store.Yes)]
		public virtual string WorksTitle
		{
			get { return _worksTitle; }
			set
			{
				if ( value != null && value.Length > 50)
					throw new ArgumentOutOfRangeException("Invalid value for WorksTitle", value, value.ToString());
				_worksTitle = value;
			}
		}

		[Field(Index.Tokenized, Store = Store.Yes)]
		public virtual string WorksUrl
		{
			get { return _worksUrl; }
			set
			{
				if ( value != null && value.Length > 200)
					throw new ArgumentOutOfRangeException("Invalid value for WorksUrl", value, value.ToString());
				_worksUrl = value;
			}
		}

		[Field(Index.Tokenized, Store = Store.Yes)]
		public virtual string WorksDesc
		{
			get { return _worksDesc; }
			set
			{
				_worksDesc = value;
			}
		}

		public virtual DateTime RegDate
		{
			get { return _regDate; }
			set { _regDate = value; }
		}

		public virtual int Idx
		{
			get { return _idx; }
			set { _idx = value; }
		}

		

		#endregion
	}
	#endregion
}